#!/bin/bash
DD=$(date +%F" "%T)

#监控5060 端口
value=$(netstat -an|grep :5060|grep -v grep|wc -l)

if [ $value -gt 0 ]; then
        kp=$(ps -ef|grep -E "/usr/sbin/keepalived$"|wc -l)
        if [ $kp -gt 0 ]; then
                echo "ok"
        else
                echo "$DD start keepalived " >> /etc/keepalived/SendSmsMail.log
                /etc/init.d/keepalived start
        fi

else
        echo "$DD port service down" >> /etc/keepalived/SendSmsMail.log
fi
